From 7c7a202cce75f550f95b2d16eb2736171ca81ad2 Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Fri, 8 Jul 2011 08:42:30 +0100 Subject: [PATCH] ns16550: Implement suspend handler. For PCI type cards, you need to disable the timer code during suspend. Otherwise during resume, the timer can be put on the heap as its being resumed and corrupt it resulting in a crash. Signed-off-by: Roger Cruz Signed-off-by: Tom Goetz Signed-off-by: Konrad Rzeszutek Wilk --- xen/drivers/char/ns16550.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c index 8d376b8fec..c360ee70f5 100644 --- a/xen/drivers/char/ns16550.c +++ b/xen/drivers/char/ns16550.c @@ -328,6 +328,12 @@ static void __init ns16550_init_postirq(struct serial_port *port) ns16550_setup_postirq(uart); } +static void ns16550_suspend(struct serial_port *port) +{ + struct ns16550 *uart = port->uart; + stop_timer(&uart->timer); +} + static void ns16550_resume(struct serial_port *port) { ns16550_setup_preirq(port->uart); @@ -355,6 +361,7 @@ static struct uart_driver __read_mostly ns16550_driver = { .init_preirq = ns16550_init_preirq, .init_postirq = ns16550_init_postirq, .endboot = ns16550_endboot, + .suspend = ns16550_suspend, .resume = ns16550_resume, .tx_empty = ns16550_tx_empty, .putc = ns16550_putc, -- 2.30.2